package com.act.constant;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


public enum  UserTypeEnums {
    PERSON(0,"个人用户","person"),
    ORG(1 ,"公司用户","org"),
    SYSTEM(2,"系统超级管理员","system");

    private Integer userType;

    private String userTypeName;

    private String typeCode;


    UserTypeEnums(Integer userType, String userTypeName,String typeCode) {
        this.userType = userType;
        this.userTypeName = userTypeName;
        this.typeCode =typeCode;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getUserTypeName() {
        return userTypeName;
    }

    public void setUserTypeName(String userTypeName) {
        this.userTypeName = userTypeName;
    }

    public String getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(String typeCode) {
        this.typeCode = typeCode;
    }

    public static String getName(Integer userType){
        for (UserTypeEnums e : UserTypeEnums.values()){
            if(e.getUserType() == userType){
                return e.getUserTypeName();
            }
        }
        return null;
    }
}
